package com.dubbo.controller;

import com.dubbo.UserService;
import com.dubbo.service.UserServiceImpl;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @DubboReference
    private UserService userService;

    @GetMapping("/get/{id}")
    public String getUser(@PathVariable("id") String id) {
        String user = userService.getUser(id);
        return user;
    }
}
